﻿@using CommandLib
@using Resources
@model FindArtInfo.Models.PagePriceDetailModel
@{
    ViewBag.Title = "A. " + HttpUtility.HtmlDecode(Model.Artist.FullName) + " - Art prices - " + Model.Price.ItemName;
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h1 class="underline">@string.Format(Multi.PagePriceDetailTitle, HttpUtility.HtmlDecode(Model.Artist.FullName))</h1>
<br />
@foreach(var item in Model.ListArtWork)
{
    string urlImage = Utils.GetUrlImage(item.ArtworkFile);
    string alt = string.Format("Artist {0} - FindArtinfo", Model.Artist.FullName);
    <img style="border:0px" src="@urlImage"  width="500px" alt="@alt" /><br />
}
<br/>
<table cellSpacing="1" cellPadding="4" bgColor="#525e54" border="0" id="table6">
    <tr vAlign="top"> 
        <td bgColor="#e3e6e0" width="117"><b>@Multi.PagePriceDetailArtistFullName</b></td>
        <td bgColor="#ffffff"> 
        @(HttpUtility.HtmlDecode(Model.Artist.FullName) + " (" + ((Model.Artist.Born == 0 ? "" : Model.Artist.Born.ToString()) + "-" + (Model.Artist.Died == 0 ? "" : Model.Artist.Died.ToString())) +") " + Model.Artist.CountryName.Replace("Country unknown", string.Empty))</td>
    </tr>
    <tr vAlign="top"> 
        <td bgColor="#e3e6e0" width="117"><b>@Multi.PagePriceDetailItemName</b></td>
        <td bgColor="#ffffff">@Model.Price.ItemName</td>
    </tr>
    <tr vAlign="top"> 
        <td bgColor="#e3e6e0" width="117"><b>@Multi.PagePriceDetailMedium</b></td>
        <td bgColor="#ffffff">@(Model.Price.ItemTypeName)&nbsp;@(Model.Price.ItemTypeDescription)</td>
    </tr>
    <tr> 
        <td bgColor="#e3e6e0" width="117"><b>@Multi.PagePriceDetailSize&nbsp;&nbsp;&nbsp;</b></td>
        <td bgColor="#ffffff"> 
       @{
            decimal H = Model.Price.Height == null ? 0 : Model.Price.Height;
            decimal W = Model.Price.Width == null ? 0 : Model.Price.Width;
            decimal D = Model.Price.Depth == null ? 0 : Model.Price.Depth;                                           
            if (D == 0)
            {
                <span>@((H + " x " + W + " in")) (@((Math.Round(H * (decimal) 2.54,2) + " x " + Math.Round(W * (decimal) 2.54,2) + " cm")))</span>
            }
            else
            {
                <span>@((H + " x " + W + " x " + D + " in")) (@((Math.Round(H*(decimal) 2.54,2) + " x " + Math.Round(W*(decimal) 2.54,2) + " x " + Math.Round(D*(decimal) 2.54,2) + " cm")))</span>
            }                                
        }
        </td>
    </tr>
    <tr> 
        <td bgColor="#e3e6e0" width="117"><b>@Multi.PagePriceDetailSigned</b></td>
        <td bgColor="#ffffff">@(Model.Price.Signed == true ? "Yes" : "No")</td>
    </tr>
    <tr> 
        <td bgColor="#e3e6e0" width="117"><b>@Multi.PagePriceDetailStamped</b></td>
        <td bgColor="#ffffff">@(Model.Price.Stamped == true ? "Yes" : "No")</td>
    </tr>
    <tr> 
        <td bgColor="#e3e6e0" width="117"><b>@Multi.PagePriceDetailInscribed</b></td>
        <td bgColor="#ffffff">@(Model.Price.Inscribed == true ? "Yes" : "No")</td>
    </tr>
    <tr> 
        <td bgColor="#e3e6e0" width="120"><b>@Multi.PagePriceDetailDating</b></td>
        <td bgColor="#ffffff">@((Model.Price.Dating!=null && Model.Price.Dating.Length > 0) ? Model.Price.Dating : "N/A")</td>
    </tr>
    <tr> 
        <td bgColor="#e3e6e0" width="117"><b>@Multi.PagePriceDetailLotNumber</b></td>
        <td bgColor="#ffffff">@(Model.Price.Lotnumber)</td>
    </tr>
    <tr> 
        <td bgColor="#e3e6e0" width="117"><b>@Multi.PagePriceDetailAuctionTime</b></td>
        <td bgColor="#ffffff">@(Model.Price.AuctionTime.ToString("MM-dd-yyyy"))</td>
    </tr>
    <tr> 
        <td bgColor="#e3e6e0" width="117"><b>@Multi.PagePriceDetailAuctionHouse</b></td>                              
        <td bgColor="#ffffff"><a href="@Model.Price.Link" target="_blank">@(Model.Price.AuctionHouseName + " - " + Model.Price.AuctionHouseSublocationName)</a></td>
    </tr>
    <tr vAlign="top"> 
        <td bgColor="#e3e6e0" width="117"><b>@Multi.PagePriceDetailEstimatedPrice</b></td>
        @{
            string Estimated = "N/A";
            if ((Model.Price.EstimatedTo < 1 || Model.Price.EstimatedTo == null) && (Model.Price.EstimatedFrom > 0))
            {
                Estimated = Utils.FomatNumber(Model.Price.EstimatedFrom.ToString()) + " " + Model.Price.ECurrency;
            }
            if ((Model.Price.EstimatedFrom < 1 || Model.Price.EstimatedFrom == null) && (Model.Price.EstimatedTo > 0))
            {
                Estimated = Utils.FomatNumber(Model.Price.EstimatedTo.ToString()) + " " + Model.Price.ECurrency;
            }
            if (Model.Price.EstimatedFrom > 0 && Model.Price.EstimatedTo > 0)
            {
                Estimated = Utils.FomatNumber(Model.Price.EstimatedFrom.ToString()) + " - " + Utils.FomatNumber(Model.Price.EstimatedTo.ToString()) + " " + Model.Price.ECurrency;
            }
        }
        <td bgColor="#ffffff">@Estimated</td>
    </tr>
    <tr vAlign="top"> 
        <td bgColor="#e3e6e0" width="117"><b>@Multi.PagePriceDetailAuctionResult</b></td>
        <td bgColor="#ffffff">@(Model.Price.Unsold ? "Unsold": Utils.FomatNumber(Model.Price.Price.ToString()) + " " + Model.Price.PCurrency)</td>
    </tr>
    <tr vAlign="top"> 
        <td bgColor="#e3e6e0" width="117"><b>@Multi.PagePriceDetailWithPremium</b></td>
        <td bgColor="#ffffff">@(Model.Price.Premium ? "Yes" : "No")</td>
    </tr>
    <tr vAlign="top"> 
        <td bgColor="#e3e6e0" width="117"><b>@Multi.PagePriceDetailEdition</b></td>
        <td bgColor="#ffffff">@((Model.Price.Edition !=null && Model.Price.Edition.Length>0) ? Model.Price.Edition : "N/A")</td>
    </tr>
    <tr vAlign="top"> 
        <td bgColor="#e3e6e0" width="117"><b>@Multi.PagePriceDetailFoundry</b></td>
        <td bgColor="#ffffff">@((Model.Price.Foundry!=null && Model.Price.Foundry.Length>0) ? Model.Price.Foundry : "N/A")</td>
    </tr>
    <tr vAlign="top"> 
        <td bgColor="#e3e6e0" width="117"><b>@Multi.PagePriceDetailImpression</b></td>
        <td bgColor="#ffffff">@((Model.Price.Impression!=null && Model.Price.Impression.Length>0) ? Model.Price.Impression : "N/A")</td>
    </tr>
</table>
<p align="right"><br>
    @Html.ActionLink(Multi.PagePriceDetailBack, null, null, new { @href = "javascript:window.history.back()"}) &nbsp; |&nbsp;<a href="~/@Utils.GetUrlByLanguage(CookiesStore.GetCookies(Constants.Cookie.COOKIE_LANGUAGE))/advanced-search.html">@Multi.PagePriceDetailNewSearch</a>&nbsp;
</p>